<template>
  <d2-container>
    <textarea
      ref="mycode"
      class="codesql public_text"
      v-model="code"
    ></textarea>
  </d2-container>
</template>

<script>
//* **************************************************************************
// codemirror
//* **************************************************************************
import CodeMirror from 'codemirror/lib/codemirror'
import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/ambiance.css'
require('codemirror/mode/javascript/javascript')

export default {
  data() {
    return {
      code: ''
    }
  },
  mounted() {
    this.editor = CodeMirror.fromTextArea(this.$refs.mycode, {
      mode: 'text/javascript',
      theme: 'ambiance',
      readOnly: true
    })
  }
}
</script>
